<template>
	<view class="content" @tap="share">
		<button open-type="share" class="sharebtn">111</button>
		<image src="http://yunzhidun.oss-cn-beijing.aliyuncs.comjing.aliyuncs.comjing.aliyuncs.comjing.aliyuncs.comjing.aliyuncs.com/uploads/20210817/153178422659c34bcc4fa618fdb81085.jpg" mode="widthFix"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:'',
				url:''
			}
		},
		onLoad() {
			this.getshare();
		},
		methods:{	
			getshare(){
				let userInfo = uni.getStorageSync('userinfo');
				uni.showLoading({
					title:"加载中"
				})
				this.$api.interfaceApi('getShare')({
					'id':userInfo.id,
					'type':1
				}).then(res=>{
					if(res.code == 200){
						this.content = res.data.content
						this.url = res.data.url
						
					}
					uni.hideLoading()
				})
			},
			
			//用户点击分享
			onShareAppMessage(e) {
				let userInfo = uni.getStorageSync('userinfo');
				
				let shareInfo = {
					path: "/pages/register/registerkq?uid="+ userInfo.id,
					title: this.content + userInfo.id,
					imageUrl: this.url
				};
				return shareInfo;
			},
		}
	}
</script>

<style lang="less" scoped>
	.content{
		button{
			width: 100%;
			height: 100vh;
			background-color: ;
			position: absolute;
			opacity: 0;
		}
		image{
			width: 100%;
		}
	}
</style>
